﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Infrastructure;

namespace Algorithms
{
    public class AlgorithmsFactory<RatingType> where RatingType: ICountable, new()
    {
        public static PredictionAlgorithm<RatingType> CreatePredictionAlgorithm(string sName)
        {
            if (sName == "Pearson")
                return new PearsonPrediction<RatingType>();
            if (sName == "Cosine")
                return new PredictCosine<RatingType>();
            if (sName == "Random")
                return new RandomRatingPredictor<RatingType>();
            if (sName == "Stereotypes")
                return null;
            return null;
        }
    }
}
